package com.shuizhu.service.impl;

import com.shuizhu.dao.db1.DemoDao;
import com.shuizhu.dao.db2.DemoOracleDao;
import com.shuizhu.domain.City;
import com.shuizhu.domain.User;
import com.shuizhu.service.IDemoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 偷懒了，直接写入到同一个service
 * @author 睡竹
 * @date 2022/9/15
 */
@Service
@RequiredArgsConstructor
public class DemoService implements IDemoService {

    //MySQL的Dao构造器注入
    final DemoDao dao1;
    //Oracle的Dao构造器注入
    final DemoOracleDao dao2;

    @Override
    public List<User> getUsers() {
        List<User> users = dao1.getUsers();
        return users;
    }

    @Override
    public List<City> getCitys() {
        List<City> citys = dao2.getCitys();
        return citys;
    }
}
